﻿/*
 * Jonathan
 * Created by: Jonathan Montiverdi
 * Date: 8/17/2012
 * License: http://jonathan.codeplex.com/license
 */
using System;
using Jonathan.DataAccess.Sqlite;

namespace Jonathan.Data
{
   /// <summary>
   /// Description of BookInfo.
   /// </summary>
   [SqliteTable ("BookInfo", SqliteTableType.Configuration)]
   public class BookInfo
   {
      /// <summary>
      /// Initilaizes a new book info object, reading the required data from the database.
      /// </summary>
      public BookInfo (Book book)
      {
         if (book == null)
            throw new ArgumentNullException ("book", "The given book cannot be null for a BookInfo object");
         this.Book = book;
         Sqlite.Read (book.FullPath, this);
      }
      
      /// <summary>
      /// Gets the main book object.
      /// </summary>
      public Book Book { get; private set; }
      
      /// <summary>
      /// Gets or Sets information about the book.
      /// </summary>
      public string Info { get; set; }
      
      /// <summary>
      /// Gets or Sets the book's contents.
      /// </summary>
      public string Contents { get; set; }
      
      /// <summary>
      /// Gets or Sets if the book has sub books or not.
      /// </summary>
      public bool HasSubBooks { get; set; }
      
      /// <summary>
      /// Gets or Sets the book's chapter title.
      /// </summary>
      public string ChapterTitle { get; set; }
      
      /// <summary>
      /// Gets or Sets the book's last modified date.
      /// </summary>
      public string LastModified { get; set; }
   }
}
